package com.traffic.api.dao;

import com.traffic.api.entity.AlipayUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface AlipayUserMapper extends BaseMapper<AlipayUser> {

    List<AlipayUser> findByConditions(Map<String, Object> conditions);

    /**
     * 条件查询 user
     *
     * @param userId
     * @return
     */
    @Select("SELECT id ,user_id AS userId,cert_no AS certNo FROM alipay_user WHERE user_id=#{userId} LIMIT 1")
    Map<String, Object> getByUserId(@Param("userId") String userId);

    @Select("SELECT id ,user_id AS userId,cert_no AS certNo FROM alipay_user WHERE cert_no=#{certNo}")
    List<Map<String, Object>> getByCertNo(@Param("certNo") String certNo);
}